home *** CD-ROM | disk | FTP | other *** search
/ Ham Radio 2000 #2 / Ham Radio 2000 - Volume 2.iso / HAMV2 / MISC / HCAL-27 / HELRESON.BAS (.txt) < prev    next >
Encoding:
GW-BASIC  |  1997-01-28  |  3.9 KB  |  146 lines

  1. 10  'HELRESON - Helical Resonators - 27 DEC 94  rev. 27 SEP 96
  2. 20  CLS:KEY OFF
  3. 30  IF EX$=""THEN EX$="EXIT"
  4. 40  COLOR 7,0,1
  5. 50  U1$="###,###.###"
  6. 60  U2$=" ###.###"
  7. 70  U3$=" ###.#"
  8. 80  UL$=STRING$(80,205)
  9. 90  '
  10. 100  '.....start
  11. 110  CLS
  12. 120  COLOR 15,2
  13. 130  PRINT " HELICAL RESONATORS (Shielded)";TAB(57);"by George Murphy VE3ERP ";
  14. 140  COLOR 1,0:PRINT STRING$(80,223);
  15. 150  COLOR 7,0
  16. 160  GOSUB 1230
  17. 170  PRINT UL$;
  18. 180  PRINT " Press number in < > to choose standard units of measure:"
  19. 190  PRINT UL$;
  20. 200  PRINT "   < 1 >  Metric"
  21. 210  PRINT "   < 2 >  U.S.A./Imperial"
  22. 220  PRINT UL$;
  23. 230  PRINT "     or Press < 0 > to EXIT....."
  24. 240  Z$=INKEY$
  25. 250  IF Z$="0"THEN CLS:RUN EX$
  26. 260  IF Z$="1"THEN UM=25.4:UM$="mm.":GOTO 290
  27. 270  IF Z$="2"THEN UM=1:UM$="in.":GOTO 290
  28. 280  GOTO 240
  29. 290  VIEW PRINT 7 TO 24:CLS:VIEW PRINT:LOCATE 7
  30. 300  GOTO 370
  31. 310  '
  32. 320  '.....display input
  33. 330  LOCATE CSRLIN-1:PRINT "        ";
  34. 340  LOCATE CSRLIN,50:PRINT USING U1$;Z*UM
  35. 350  RETURN
  36. 360  '
  37. 370  '.....start
  38. 380  VIEW PRINT 7 TO 24:CLS:VIEW PRINT:LOCATE 7
  39. 390  '
  40. 400  '.....input frequency
  41. 410  INPUT " ENTER: Resonant frequency (MHz).................   ";F
  42. 420  Z=F:GOSUB 320
  43. 430  '
  44. 440  '.....input shield I.D.
  45. 450  PRINT " ENTER: Shield Inside Diameter (";UM$;").............";:INPUT SD
  46. 460  SD=SD/UM:Z=SD:GOSUB 320
  47. 470  '
  48. 480  '.....input coil wire thickness
  49. 490  PRINT " ENTER: Coil conductor thickness (";UM$;")...........";:INPUT WT
  50. 500  WT=WT/UM:Z=WT:GOSUB 320
  51. 510  '
  52. 520  '.....input coil diameter
  53. 530  COLOR 0,7:LOCATE CSRLIN+1
  54. 540  PRINT " Coil FORM diameter should be within the range of";
  55. 550  PRINT USING U2$;(SD*0.45-WT)*UM;
  56. 560  PRINT " ";UM$;" to";USING U2$;(SD*0.6-WT)*UM;:PRINT " ";UM$;" "
  57. 570  COLOR 7,0:LOCATE CSRLIN-2
  58. 580  PRINT " ENTER: Coil FORM diameter (";UM$;").................";:INPUT CF
  59. 590  CF=CF/UM:
  60. 600  LN=CSRLIN:VIEW PRINT LN TO 24:CLS:VIEW PRINT:LOCATE LN
  61. 610  Z=CF:GOSUB 320
  62. 620  CD=CF+WT
  63. 630  PRINT "        Coil diameter (";UM$;")......................   ";
  64. 640  PRINT USING U2$;CD*UM
  65. 650  '
  66. 660  '.....input coil length
  67. 670  COLOR 0,7:LOCATE CSRLIN+1
  68. 680  PRINT " Turn spacing should be within the range of";
  69. 690  PRINT USING U2$;WT/0.7*UM;:PRINT " ";UM$;" to";USING U2$;WT/0.5*UM;
  70. 700  PRINT " ";UM$;" "
  71. 710  COLOR 7,0:LOCATE CSRLIN-2
  72. 720  PRINT " ENTER: Turn spacing (";UM$;").......................";:INPUT SP
  73. 730  LN=CSRLIN:VIEW PRINT LN TO 24:CLS:VIEW PRINT:LOCATE LN
  74. 740  SP=SP/UM:Z=SP:GOSUB 320
  75. 750  '
  76. 760  '.....number of turns & turns-per-inch
  77. 770  TP=1/SP
  78. 780  PRINT "        Turns per 25 mm (inch)...................   ";USING U2$;TP
  79. 790  NT=1900/(F*SD)
  80. 800  PRINT "        Number of turns..........................   ";USING U2$;NT
  81. 810  '
  82. 820  '.....coil length
  83. 830  CL=SP*NT
  84. 840  PRINT "        Coil length (";UM$;")........................   ";
  85. 850  PRINT USING U2$;CL*UM
  86. 860  '
  87. 870  '.....coil ratios
  88. 880  R1=CL/CD:IF R1>1 AND R1<4 THEN 900
  89. 890  COLOR 0,7
  90. 900  PRINT "        Coil length-to-diameter ratio............   ";USING U2$;R1;
  91. 910  PRINT ":1                 "
  92. 920  IF R1>1 AND R1<4 THEN 1010
  93. 930  IF R1<=1 THEN R$="larger"
  94. 940  IF R1>=4 THEN R$="smaller"
  95. 950  PRINT " Ratio should be between 1:1 and 4:1";
  96. 960  PRINT " - Try again with a ";R$;" conductor. "
  97. 970  LOCATE CSRLIN,24:PRINT " Press any key to start over....."
  98. 980  IF INKEY$=""THEN 980
  99. 990  COLOR 7,0:GOTO 370
  100. 1000  '
  101. 1010  COLOR 7,0
  102. 1020  R2=CD/SD
  103. 1030  PRINT "        Coil diameter-to-shield diameter ratio...   ";USING U2$;R2;
  104. 1040  PRINT ":1"
  105. 1050  '
  106. 1060  '.....shield length
  107. 1070  SL=CL+SD/2
  108. 1080  PRINT "        Approximate shield length (";UM$;")..........   ";
  109. 1090  PRINT USING U3$;SL*UM
  110. 1100  '
  111. 1110  '.....characteristic impedance
  112. 1120  CZ=98*10^3/(F*SD)
  113. 1130  PRINT "        Characteristic impedance (ohms)..........";USING U1$;CZ
  114. 1140  '
  115. 1150  '.....unloaded Q
  116. 1160  QU=50*SD*SQR(F)
  117. 1170  PRINT "        Unloaded Q...............................";USING U1$;QU
  118. 1180  PRINT UL$;
  119. 1190  GOSUB 1330
  120. 1200  GOTO 100   'start
  121. 1210  END
  122. 1220  '
  123. 1230  '.....preface
  124. 1240  TB=8
  125. 1250  PRINT TAB(TB);
  126. 1260  PRINT "This program does calculations associated with the description of"
  127. 1270  PRINT TAB(TB);
  128. 1280  PRINT "Helical Resonators in the ARRL ELECTRONICS DATA BOOK, 2nd Edition,"
  129. 1290  PRINT TAB(TB);
  130. 1300  PRINT "Networks and Filters section, pages 5-10 and 5-11."
  131. 1310  RETURN
  132. 1320  '
  133. 1330  'HARDCOPY
  134. 1340  GOSUB 1450:LOCATE 25,2:COLOR 14,6
  135. 1350  PRINT " Press 1 to print screen, 2 to print screen & ";
  136. 1360  PRINT "advance paper, or 3 to continue.";:COLOR 7,0
  137. 1370  Z$=INKEY$:IF Z$="3"THEN GOSUB 1450:RETURN
  138. 1380  IF Z$="1"OR Z$="2"THEN GOSUB 1450:GOTO 1400
  139. 1390  GOTO 1370
  140. 1400  FOR QX=1 TO 24:FOR QY=1 TO 80
  141. 1410  LPRINT CHR$(SCREEN(QX,QY));
  142. 1420  NEXT QY:NEXT QX
  143. 1430  IF Z$="2"THEN LPRINT CHR$(12)
  144. 1440  GOTO 1340
  145. 1450  LOCATE 25,1:PRINT STRING$(80,32);:RETURN
  146.